#!/bin/bash
while true
do
  connectionsNum=`netstat -apnt | grep 9080|grep -i ESTABLISH|wc -l`
  if [ $connectionsNum -gt 80000 ];then
  ps aux | grep P2P_conf|awk '{print $2}'|xargs kill -9 
  echo "connectionsNum = $connectionsNum   `date +%Y-%m-%d\ %H:%M:%S` " >> chongqi.txt
  fi
  sleep 5
done
